package 结构型模式.装饰者模式;

public class Client {
    public static void main(String[] args) {
        //点一份炒饭
        FastFood food=new FiredRice();

        System.out.println(food.getDesc()+" "+food.cost()+"元");

        System.out.println("_____________________");
        //在上面的炒饭中加鸡蛋
        food=new Egg(food);
        System.out.println(food.getDesc()+" "+food.cost()+"元");

        System.out.println("_____________________");
        //在上面的炒饭再中加一个鸡蛋
        food=new Egg(food);
        System.out.println(food.getDesc()+" "+food.cost()+"元");

        System.out.println("_____________________");
        //在上面的炒饭中再加一个培根
        food=new Bacon(food);
        System.out.println(food.getDesc()+" "+food.cost()+"元");


    }
}
